package com.study.cloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope     //需运维人员发送 curl -X POST "http://localhost:3355/actuator/refresh"  // 定点通知curl -X POST "http://localhost:3344/actuator/bus-refresh/config-client:3355"
public class ConfigClientController {

    @Value("${config.info}")
    private String configInfo;

    @RequestMapping(value = "/getConfigInfo", method = RequestMethod.GET)
    public String getConfigInfo() {
        return configInfo;
    }
}
